<div id="tenant-form">
	<p style="font: normal 12px/15px Arial;">Tab or click through the
		fields to reveal the hints.</p>

	<dt>
		<label for="username">Username:</label>
	</dt>
	<dd>
		<input name="username" id="username" type="text" /> <span class="hint">Between
			4-12 characters.[a-z A-Z 0-9 . _ ] are allowed.<span
			class="hint-pointer">&nbsp;</span>
		</span>
	</dd>
	<dt>
		<label for="password">Password</label>
	</dt>
	<dd>
		<input name="password" id="password" type="password" /> <span
			class="hint">Between 5-13 characters, but not 7. Never 7.<span
			class="hint-pointer">&nbsp;</span>
		</span>
	</dd>
	<dt class="button">&nbsp;</dt>
	<dd class="button">
		<input type="submit" class="button" value="Submit" id="submitbtn" />
	</dd>
	</dl>

</div>


<script type="text/javascript">

function submitButtonOnClick(){

  var username = $("input#username").val();
  var password = $("input#password").val();
  var dataString = '&username=' + username+'&password=' + password ;

	$.ajax({
		type: "POST",
			url: "index.php/process/tenant_login",
			data: dataString,
			success :function(data){
				if(data=='1'){
					$('div#login-bar-placeholder').load('index.php/viewloader/tenant_login_bar');
					$('div#tenant-page').load('index.php/viewloader/tenant_main');
				}else{
					alert('data0');
				}

		    }
	});

}
$(document).ready(function(){
	prepareInputsForHints();

	$('#submitbtn').click(function(){

		submitButtonOnClick();


	});
	

});


</script>
